﻿<Window x:Class="DaxStudio.UI.Experiments.CopyPaste"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
        Title="CopyPaste" Height="370.833" Width="425">
    <Window.Resources>
        <SolidColorBrush x:Key="SpinnerColorBrush" Color="#FF0072D4">
        </SolidColorBrush>
        <Storyboard x:Key="Rotation">

            <DoubleAnimation Storyboard.TargetName="rotateTransform"
                       Storyboard.TargetProperty="Angle"
                       From="0" To="360" Duration="00:00:01"
                       RepeatBehavior="Forever"/>
        </Storyboard>

        <ControlTemplate x:Key="Spinner">
            <Grid Name="LayoutRoot" RenderTransformOrigin="0.5,0.5">
                <Grid.RenderTransform>
                    <TransformGroup>
                        <RotateTransform x:Name="rotateTransform"/>
                    </TransformGroup>
                </Grid.RenderTransform>
                <Ellipse Fill="{DynamicResource SpinnerColorBrush}">
                    <Ellipse.OpacityMask>
                        <ImageBrush ImageSource="Images/SpinnerMask.png" Stretch="None"/>
                    </Ellipse.OpacityMask>
                </Ellipse>
                <Grid.OpacityMask>
                    <RadialGradientBrush>
                        <GradientStop Color="Black" Offset="0.96"/>
                        <GradientStop Color="Transparent" Offset="0.959"/>
                    </RadialGradientBrush>
                </Grid.OpacityMask>
            </Grid>
        </ControlTemplate>
        <BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
    </Window.Resources>
    <Grid>
        <StackPanel  >

            <ToolBar >
                <Button Content="Cut" Command="ApplicationCommands.Cut" Height="23" Width="75">
                </Button>
                <Button Content="Copy"  Command="ApplicationCommands.Copy" Height="23" Width="75" >
                </Button>
                <Button Content="Paste" Command="ApplicationCommands.Paste" Height="23" Width="75">
                </Button>
            </ToolBar>
            <xctk:BusyIndicator IsBusy="True"  >

                <xctk:BusyIndicator.BusyContentTemplate>
                    <DataTemplate>
                        <StackPanel Margin="4">

                            <StackPanel Margin="4" Orientation="Horizontal">
                                <Grid Name="LayoutRoot" RenderTransformOrigin="0.5,0.5" Width="14" Height="14" Visibility="Visible">
                                    <Grid.RenderTransform>
                                        <TransformGroup>
                                            <RotateTransform x:Name="rotateTransform"/>
                                        </TransformGroup>
                                    </Grid.RenderTransform>
                                    <Ellipse Fill="{DynamicResource SpinnerColorBrush}">
                                        <Ellipse.OpacityMask>
                                            <ImageBrush ImageSource="Images/SpinnerMask.png" Stretch="None"/>
                                        </Ellipse.OpacityMask>
                                    </Ellipse>
                                    <Grid.OpacityMask>
                                        <RadialGradientBrush>
                                            <GradientStop Color="Black" Offset="0.96"/>
                                            <GradientStop Color="Transparent" Offset="0.7"/>
                                        </RadialGradientBrush>
                                    </Grid.OpacityMask>
                                    <Grid.Triggers>
                                        <EventTrigger RoutedEvent="Window.Loaded">
                                            <BeginStoryboard>
                                                <Storyboard>
                                                    <DoubleAnimation Storyboard.TargetName="rotateTransform"
                                            Storyboard.TargetProperty="Angle"
                                            From="0" To="360" Duration="00:00:01"
                                            RepeatBehavior="Forever"/>
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </EventTrigger>
                                    </Grid.Triggers>
                                </Grid>
                                <TextBlock Text="Loading Metadata..." FontWeight="SemiBold" HorizontalAlignment="Center" Margin="5" Foreground="{StaticResource SpinnerColorBrush}"/>
                            </StackPanel>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>

                                </Grid.ColumnDefinitions>

                            </Grid>
                        </StackPanel>
                    </DataTemplate>
                </xctk:BusyIndicator.BusyContentTemplate>
                <xctk:BusyIndicator.OverlayStyle>
                    <Style TargetType="Rectangle">
                        <Setter Property="Fill" Value="#33000000"/>
                    </Style>
                </xctk:BusyIndicator.OverlayStyle>
                <xctk:BusyIndicator.ProgressBarStyle>
                    <Style TargetType="ProgressBar">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </Style>
                </xctk:BusyIndicator.ProgressBarStyle>


                <!--  Normal controls -->
                <StackPanel  Height="300">
                    <Label>Label 1</Label>
                    <TextBox Height="23" Name="textBox1" Width="120" />
                    <Label>Label 2</Label>
                    <TextBox Height="23" Name="textBox2" Width="120" />
                    <Label>Label 3</Label>
                    <TextBox Height="23" Name="textBox3" Width="120" />
                </StackPanel>
            </xctk:BusyIndicator>
        </StackPanel>
    </Grid>
</Window>
